package com.yanqu.road.server.cmd.banquet.cross;

import com.yanqu.road.pb.banquet.CrossBanquetProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_CROSS_BANQUET_CHAT_LIST, desc = "拉取跨服宴会聊天列表")
public class CrossBanquetChatListCmd extends AbstractCommand {

	private String banquetId;

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		CrossBanquetProto.CrossBanquetChatListReqMsg reqMsg = CrossBanquetProto.CrossBanquetChatListReqMsg.parseFrom(packet.getBytes());
		banquetId = reqMsg.getBanquetId();
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		//上跨服拉聊天数据
		CrossBanquetProto.CrossBanquetChatListReqMsg.Builder msg = CrossBanquetProto.CrossBanquetChatListReqMsg.newBuilder();
		msg.setBanquetId(banquetId);
		YanQuMessage pbMsg = YanQuMessageUtils.buildMessage(Protocol.C_CROSS_BANQUET_CHAT_LIST, msg);
		GamePlayerMgr.sendPacket(player.getUserId(), pbMsg);
	}

	@Override
	public void sendData(GamePlayer player) {

	}
}
